﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="cramListTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Register
</asp:Content>

<asp:Content ID="cramListContent" ContentPlaceHolderID="MainContent" runat="server">
     <style type="text/css">  

         .green  

         {  

             color: Green;  

         }  

         .red  

         {  

             color: Red;  

         }  

     </style>  

     <script type="text/javascript">

         $(document).ready(function () {
             debugger;
             //Display the jquery grid that contains the cram list
             $("#list").jqGrid({
                 url: '/Cram/GetGridCramData/', //the datasource
                 datatype: "json",
                 mtype: 'GET',
                 colNames: ['Id', 'Creation Date', 'Status', 'LastModificationDate', '', ''],
                 colModel: [
                               { name: 'id', index: 'id', hidden: true, width: 0, align: 'left' },
                               { name: 'creationDate', index: 'creationDate', width: 150, align: 'left' },
                               { name: 'status', index: 'status', width: 150, align: 'left' },
                               { name: 'LastModificationDate', index: 'LastModificationDate', width: 150, align: 'left' },
                               { name: 'display', index: 'edit', edittype: 'select', formatter: 'showlink', formatoptions: { baseLinkUrl: '', showAction: 'CramView', addParam: '' }, align: 'left' },
                               { name: 'print', index: 'print', formatter: 'showlink', formatoptions: { baseLinkUrl: '', showAction: 'CramPrint', addParam: '' }, align: 'left' }
                           ],
                 rowNum: 10,
                 rowList: [5, 10, 20, 30, 50],
                 pager: jQuery('#pager'),
                 viewrecords: true,
                 sortname: '0',
                 sortorder: "asc",
                 imgpath: '/scripts/themes/coffee/images',
                 caption: '<b>eCram Cram Informations</b>',
                 width: 800,
                 height: 270
                 //                 ,onSelectRow: function (rowid) {
                 //                     var id = $('#list').getCell(rowid, 'Id');
                 //                     selectedCramId = id;                     
                 //                 }
             }).navGrid(pager, { edit: false, add: false, del: false, refresh: true, search: false });
         });


         function showlink(cellvalue, options, rowObject) {
            // alert('dfzzafe');
             //return "<a href=/Account/Register</a>"; 
         }

     </script>      
    <% using (Html.BeginForm("Add", "Cram")) 
    { 
        %><h2>Cram list</h2>
     <div class="divGrid">
        <table id="list" class="scroll" cellpadding="0" cellspacing="0"  width="100%"></table> 
        <div id="pager"  class="scroll" style="text-align:center;">
        </div> 
        <p>
            <button name="button" value="New" class="button" >New cram</button>                            
        </p>
        
        
    </div><%
        
     } %>
</asp:Content>

